home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Assembly / AOA.ZIP / CH08 / EX8_1.ASM < prev    next >
Encoding:
Assembly Source File  |  1996-02-06  |  1009 b   |  73 lines

  1. ; EX8_1.asm (Laboratory Exercise 8.1)
  2.  
  3.  
  4. dseg        segment    para public 'data'
  5. dseg        ends
  6.  
  7. cseg        segment    para public 'code'
  8.         assume    cs:cseg, ds:dseg
  9.  
  10.  
  11.  
  12. Procedure1    proc    near
  13.  
  14. ; MASM will emit a *far* call to procedure2
  15. ; since it is a far procedure.
  16.  
  17.         call    Procedure2
  18.  
  19. ; Since this return instruction is inside
  20. ; a near procedure, MASM will emit a near
  21. ; return.
  22.  
  23.         ret
  24. Procedure1    endp
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. Procedure2    proc    far
  32.  
  33. ; MASM will emit a *near* call to procedure1
  34. ; since it is a near procedure.
  35.  
  36.         call    Procedure1
  37.  
  38. ; Since this return instruction is inside
  39. ; a far procedure, MASM will emit a far
  40. ; return.
  41.  
  42.         ret
  43. Procedure2    endp
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. Main        proc
  51.         mov    ax, dseg
  52.         mov    ds, ax
  53.         mov    es, ax
  54.  
  55.  
  56. ; MASM emits the appropriate call instructions
  57. ; to the following procedures.
  58.  
  59.         call    Procedure1
  60.         call    Procedure2
  61.  
  62.  
  63. Quit:        mov    ah, 4ch
  64.         int    21h
  65. Main        endp
  66.  
  67. cseg        ends
  68.  
  69. sseg        segment    para stack 'stack'
  70. stk        byte    1024 dup ("stack   ")
  71. sseg        ends
  72.         end    Main
  73.